using System;
using System.Collections.Generic;
using System.Text;
using Cores;
using DAOLayer;
using System.Data;

namespace BUSLayer
{
    public class LichChieuBus
    {
        LichChieuDao LCdao;
        public DataTable LayLichChieu(int maphim)
        {
            DateTime dt = DateTime.Now;
            DayOfWeek firstday = DayOfWeek.Monday;
            DayOfWeek today = dt.DayOfWeek;

            int Fdiff = 0;

            if (today == DayOfWeek.Sunday)
                Fdiff = 6;
            else
                Fdiff = today - firstday;
            DateTime NgayBD = dt.AddDays(-Fdiff);
            DateTime NgayKT = NgayBD.AddDays(14);

            LCdao = new LichChieuDao();

            return LCdao.LayLichChieu(maphim, NgayBD, NgayKT);

        }
    }
}
